<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Resources extends Model
{
    use HasFactory;
    protected $table = 'zfm_resources';
    protected $guarded = [];

    /**
     * 房源列表
     * @yuankai
     */
    public static function list()
    {
        return self::all();
    }

    /**
     * @param $category
     * @return mixed
     * 房源分类搜索
     * @yuankai
     */
    public static function search($where)
    {
        return self::where($where)->get();
    }

    /**
     * @param $neighborhood
     * @return mixed
     * 附近房源
     * @yuankai
     */
    public static function nearby_search($where)
    {
        return self::where($where)->get();
    }

    /**
     * 房源价格区间查询
     * @yuankai
     */
    public static function price($where)
    {
        return self::where($where)->get();
    }

    /**
     * 房源户型查询
     * @yuankai
     */
    public static function house_type($where)
    {
        return self::where($where)->get();
    }

    /**
     * 房源多条件搜索
     * @yuankai
     */
    public static function more($where)
    {
        return self::where($where)->get();
    }
}
